﻿using System.Collections.Generic;
using RaptorEngine;
using RaptorEngine.Managers;

namespace OilRigSumoWrestlers.KeyBindings
{
    abstract class KeyBindingCollection
    {
        protected Dictionary<string, InputCommand> bindings = new Dictionary<string, InputCommand>();

        public void Add(string key, InputCommand binding)
        {
            if (!bindings.ContainsKey(key))
                bindings.Add(key, binding);
        }
        public void Remove(string key)
        {
            bindings.Remove(key);
        }
        public void Clear()
        {
            bindings.Clear();
        }

        public virtual void ActivateBindings()
        {
            foreach (KeyValuePair<string, InputCommand> binding in bindings)
            {
                GameEngine.Instance.Input.AddCommand(binding.Key, binding.Value);
            }
        }
    }
}
